home *** CD-ROM | disk | FTP | other *** search
- Opt c-
- Section "Vektor Zoomer",Code_c
-
- InvertBlock = 0
-
- IncDir TransorbSource:
-
- Start Bra.s SetNewObject
- Bra.s CLSDoubleBuffer
- Bra DoObject
-
- SetNewObject Lea ObjectPt(pc),a1
- Move.l a0,(a1)
- Moveq #0,d0
- Move.w (a0),d0
- Asl.w #2,d0
- Move.l a0,a2
- Addq #2,a2
- Add.l d0,a2
- Lea ConnectPt(pc),a3
- Move.l a2,(a3)
- Rts
-
- CLSDoubleBuffer Bsr ClsBlock
- Lea Altern8(pc),a0
- Bchg #0,(a0)
- Rts
-
- DoObject Lea ScreenBase(pc),a6
- Move.l a0,(a6)+
- Move.l a0,(a6)
- Lea XSize(pc),a6
- Move.w d0,0(a6)
- Move.w d1,2(a6)
- Bsr Rotate
- Bsr DrawLines
- Bsr FillBlock
- Rts
-
- WaitBlitter Btst #14,$02(a6)
- Btst #14,$02(a6)
- Bne WaitBlitter
- Rts
-
- ClsBlock Move.l a0,d0
- Lea Altern8(pc),a0
- Btst #0,(a0)
- Bne ClsMap1
-
- ClsMap0 Lea MaxXStart(pc),a0
- Bra ClsMap
- ClsMap1 Lea MaxXStart1(pc),a0
-
- ClsMap Moveq #0,d1
- Moveq #0,d2
- Moveq #0,d5
-
- Move.w 4(a0),d1
- Move.w 6(a0),d5
- Sub.w d1,d5
- Add.w #1,d5
- Asl.w #6,d5
- Moveq #44,d3
- Muls d1,d3
- Add.l d3,d0
- Move.w 0(a0),d1
- Move.w 2(a0),d2
- Asr.w #3,d1
- Asr.w #3,d2
- And.w #$0ffe,d1
- And.w #$0ffe,d2
- Add.l d1,d0
- Sub.w d1,d2
- Add.w #2,d2
- Moveq #44,d4
- Sub.w d2,d4
- Asr.w #1,d2
- Or.w d2,d5
-
- Lea $Dff000,a6
- Bsr WaitBlitter
- Move.l #-1,BltAFWM(a6)
- Move.l #$01000000,BltCon0(a6)
- Move.w d4,BltDMod(a6)
- Move.l d0,BltDPth(a6)
- Move.w d5,BltSize(a6)
- Rts
-
- FillBlock Move.l Screen(pc),d0
- Lea Altern8(pc),a0
- Btst #0,(a0)
- Beq FillMap1
-
- FillMap0 Lea MaxXStart(pc),a0
- Bra FillMap
- FillMap1 Lea MaxXStart1(pc),a0
-
- FillMap Moveq #0,d1
- Moveq #0,d2
- Moveq #0,d5
-
- Move.w 4(a0),d1
- Move.w 6(a0),d5
- Sub.w d1,d5
- Asl.w #6,d5
- Moveq #44,d3
- Move.w 6(a0),d1
- Muls d1,d3
- Add.l d3,d0
- Move.w 0(a0),d1
- Move.w 2(a0),d2
- Asr.w #3,d1
- Asr.w #3,d2
- And.w #$0ffe,d1
- And.w #$0ffe,d2
- Add.l d2,d0
- Sub.w d1,d2
- Add.w #2,d2
- Moveq #44,d4
- Sub.w d2,d4
- Asr.w #1,d2
- Or.w d2,d5
-
- Lea $Dff000,a6
- Bsr WaitBlitter
- Move.l #-1,BltAFWM(a6)
- Move.l #$09f0000a+(InvertBlock*4),BltCon0(a6)
- Move.w d4,BltDMod(a6)
- Move.w d4,BltAMod(a6)
- Move.l d0,BltDPth(a6)
- Move.l d0,BltAPth(a6)
- Move.w d5,BltSize(a6)
- Rts
-
- Rotate Bsr SetMax
- Lea RotPoints(pc),a0 ; Dest For Points
- Move.l ObjectPt(pc),a1
- Lea XSize(pc),a2
- Move.w (a1)+,d7 ; Number Of Points
- Sub.w #1,d7
-
- Calculate Move.w (a1)+,d0 ; Get X
- Move.w (a1)+,d1 ; Get Y
-
- And.w #1023,0(a2)
- And.w #1023,2(a2)
-
- Move.w 0(a2),d2
- Move.w 2(a2),d3
-
- Muls d2,d0
- Muls d3,d1
-
- Asr.l #8,d0
- Asr.l #8,d1
-
- Asr.l #2,d0
- Asr.l #2,d1
-
- Add.w #160,d0
- Add.w #128,d1
- Move.w d0,(a0)+
- Move.w d1,(a0)+
- Bsr FindMax
- Dbf d7,Calculate
- Rts
-
- DrawLines Lea RotPoints(pc),A3 ; Pointer To Points
- Lea ConnectPt(pc),A4 ; Pointer To Connects
- Move.l (a4),a4
- Move.w (a4)+,D7 ; Number Of Connects
- Sub.w #1,d7
-
- DrawLoop Move.w (a4)+,d4 ; Conect These
- Asl.w #2,d4
- Move.w (a3,d4),D0 ; Get X
- Move.w 2(a3,d4),D1 ; Get Y
- Move.w (a4)+,d4 ; Conect These
- Asl.w #2,d4
- Move.w (a3,d4),D2 ; Get X1
- Move.w 2(a3,d4),D3 ; Get Y1
- Movem.l d0-d7/a0-a6,-(sp)
- Bsr Vec
- Movem.l (sp)+,d0-d7/a0-a6
- Dbf d7,DrawLoop
- Rts
-
- SetMax Lea Altern8(pc),a0
- Btst #0,(a0)
- Beq SetMax1
-
- SetMax0 Lea MaxXStart(pc),a0
- Bra SetMaxDone
- SetMax1 Lea MaxXStart1(pc),a0
-
- SetMaxDone Move.w #160,0(a0)
- Move.w #160,2(a0)
- Move.w #128,4(a0)
- Move.w #128,6(a0)
- Rts
-
- FindMax Movem.l d0-d3/a0,-(sp)
- Lea Altern8(pc),a0
- Btst #0,(a0)
- Beq FindMax1
-
- FindMax0 Lea MaxXStart(pc),a0
- Bra FindMaxDone
- FindMax1 Lea MaxXStart1(pc),a0
-
- FindMaxDone Move.w 0(a0),d2
- Cmp.w d2,d0
- Ble SetNewMaxXStart
- FindXStop Move.w 2(a0),d2
- Cmp.w d0,d2
- Ble SetNewMaxXStop
- FindYStart Move.w 4(a0),d2
- Cmp.w d2,d1
- Ble SetNewMaxYStart
- FindYStop Move.w 6(a0),d2
- Cmp.w d1,d2
- Ble SetNewMaxYStop
- FoundMax Movem.l (sp)+,d0-d3/a0
- Rts
-
- SetNewMaxXStart Move.w d0,0(a0)
- Bra FindXStop
- SetNewMaxXStop Move.w d0,2(a0)
- Bra FindYStart
- SetNewMaxYStart Move.w d1,4(a0)
- Bra FindYStop
- SetNewMaxYStop Move.w d1,6(a0)
- Bra FoundMax
-
- vec Move.l Screen(pc),a0
- Lea $Dff000,a6
- Move.l #44,D5 ; 40 Bytes accross
- Bsr WaitBlitter
- Move.w d5,$60(a6) ; Screen In Bytes
- Move.l #-$8000,$72(a6) ; Set to line ??????
- Move.l #-1,$44(a6) ; The Mask
- cmp.w d1,d3
- bgt.s line1
- exg d0,d2
- exg d1,d3
- beq.s out
- line1 move.w d1,d4
- muls d5,d4
- move.w d0,d5
- add.l a0,d4
- asr.w #3,d5
- add.w d5,d4
- moveq #0,d5
- sub.w d1,d3
- sub.w d0,d2
- bpl.s line2
- moveq #1,d5
- neg.w d2
- line2 move.w d3,d1
- add.w d1,d1
- cmp.w d2,d1
- dbhi d3,line3
- line3 move.w d3,d1
- sub.w d2,d1
- bpl.s line4
- exg d2,d3
- line4 addx.w d5,d5
- add.w d2,d2
- move.w d2,d1
- sub.w d3,d2
- addx.w d5,d5
- and.w #15,d0
- ror.w #4,d0
- or.w #$a4a,d0
- move.w d2,$52(a6)
- sub.w d3,d2
- lsl.w #6,d3
- addq.w #2,d3
- move.w d0,$40(a6)
- move.b oct(PC,d5.w),$43(a6)
- move.l d4,$48(a6)
- move.l d4,$54(a6)
- movem.w d1/d2,$62(a6)
- move.w d3,$58(a6)
- out Rts
-
- oct dc.l $3431353,$b4b1757
-
- ScreenBase Dc.l 0
- Screen Dc.l 0
- Altern8 Dc.w 0
- CopPlane Dc.w 0
- ObjectPt Dc.l 0
- ConnectPt Dc.l 0
-
- XSize Dc.w 1000
- YSize Dc.w 1000
-
- MaxXStart Dc.w 160
- MaxXStop Dc.w 160
- MaxYStart Dc.w 128
- MaxYStop Dc.w 128
-
- MaxXStart1 Dc.w 160
- MaxXStop1 Dc.w 160
- MaxYStart1 Dc.w 128
- MaxYStop1 Dc.w 128
-
- RotPoints Ds.w 240
-
- ****Custom Chip Registers****
-
- ;Control Registers
-
- Dmaconr = $002
- Vposr = $004
- Vhposr = $006
- Joy0dat = $00A
- Joy1dat = $00C
- Clxdat = $00E
- Intenar = $01C
- Intereqr = $01E
- Copcon = $02E
-
- ;Blitter Registers
-
- Bltcon0 = $040
- Bltcon1 = $042
- Bltafwm = $044
- Bltalwm = $046
- Bltcpth = $048
- Bltcptl = $04A
- Bltbpth = $04C
- Bltbptl = $04E
- Bltapth = $050
- Bltaptl = $052
- Bltdpth = $054
- Bltdptl = $056
- Bltsize = $058
- Bltcmod = $060
- Bltbmod = $062
- Bltamod = $064
- Bltdmod = $066
- Bltcdat = $070
- Bltbdat = $072
- Bltadat = $074
-
- ;Copper Registers
-
- Cop1lc = $080
- Cop1lch = $080
- Cop1lcl = $082
- Cop2lc = $084
- Cop2lch = $084
- Cop2lcl = $086
- Copjmp1 = $088
- Copjmp2 = $08A
- Diwstrt = $08E
- Diwstop = $090
- Ddfstrt = $092
- Ddfstop = $094
- Dmacon = $096
- Clxcon = $098
- Intena = $09A
- Intreq = $09C
-
- ;BitPlane Registers
-
- BplCon0 = $100
- BplCon1 = $102
- BplCon2 = $104
- BplMod1 = $108
- BplMod2 = $10a
-
- BplPt0h = $0e0
- BplPt0l = $0e2
- BplPt1h = $0e4
- BplPt1l = $0e6
- BplPt2h = $0e8
- BplPt2l = $0ea
- BplPt3h = $0ec
- BplPt3l = $0ee
- BplPt4h = $0f0
- BplPt4l = $0f2
- BplPt5h = $0f4
- BplPt5l = $0f6
-
- ;Colorour Registers
-
- Color00 = $180
- Color01 = $182
- Color02 = $184
- Color03 = $186
- Color04 = $188
- Color05 = $18a
- Color06 = $18c
- Color07 = $18e
- Color08 = $190
- Color09 = $192
- Color10 = $194
- Color11 = $196
- Color12 = $198
- Color13 = $19a
- Color14 = $19c
- Color15 = $19e
- Color16 = $1a0
- Color17 = $1a2
- Color18 = $1a4
- Color19 = $1a6
- Color20 = $1a8
- Color21 = $1aa
- Color22 = $1ac
- Color23 = $1ae
- Color24 = $1b0
- Color25 = $1b2
- Color26 = $1b4
- Color27 = $1b6
- Color28 = $1b8
- Color29 = $1ba
- Color30 = $1bc
- Color31 = $1be
-
- EcsNop = $1fe
-
-
-
-